package com.yonyou.pmclouds.basecom.bp.processor;

import com.yonyou.pmclouds.basecom.runtime.RuntimeEnvironment;
import com.yonyou.pmclouds.basecom.util.BeanHelper;
import com.yonyou.pmclouds.basecom.util.CommonFieldConst;

import java.util.Date;

public class AuditInfoInsertProcessor<T> implements SingleProcessor<T> {
    @Override
    public void process(T vo, T orig) {
        if (BeanHelper.getProperty(vo, CommonFieldConst.CREATOR) == null) {
            BeanHelper.setProperty(vo, CommonFieldConst.CREATOR, RuntimeEnvironment.getLoginUserId());
        }

        BeanHelper.setProperty(vo, CommonFieldConst.CREATIONTIME, new Date(System.currentTimeMillis()));
    }
}
